import React from 'react';
import Child from './Child';
import {Button} from 'antd';
import './a.less';

export default class life extends React.Component{
  constructor(props){
    super(props)
    this.state={
      count:0
    }
  }

  handAdd(){
    this.setState({
      count:this.state.count+1
    })
  }

  render(){
    return <div  className="content">
      <p>生命周期介绍</p>
      <Button onClick={this.handAdd.bind(this)}>点击一下</Button>
      <p>{this.state.count}</p>
      <Child name={this.state.count}/>
    </div>
  }
}